from django.template import Library

register = Library()  # 创建library对象


@register.filter()
def md(value):
    import markdown
    return markdown.markdown(value)
